package com.ruicar.afs.cloud.common.voucher.handle;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.common.config.VoucherConstant;
import com.ruicar.afs.cloud.common.datasync.api.IParamSync;
import com.ruicar.afs.cloud.common.datasync.define.Key;
import com.ruicar.afs.cloud.common.datasync.exception.ParamSyncException;



/**
 * VoucherSync
 * <p>Description: </p>
 * @version 1.0
 */
public class VoucherSync implements IParamSync {

    /**
     * Gets key * <p>Description: </p>
     *
     * @return the key
     */
    @Override
    public Key getKey() {
        return  VoucherConstant.VOUCHER_SYNC_KEY;
    }

    /**
     * On sync *
     *
     * @param params params
     * @throws ParamSyncException param sync exception
     */
    @Override
    public void onSync(JSONObject params) throws ParamSyncException {
        VoucherHelper.updateVouchers(params);
    }
}
